package io.dy.loop_execute;

/**
 * @author : dmj
 * @date: 2024/7/4 5:19 下午
 * @description: 测试主函数
 */
public class WaitNotifyLoopExecuteMain {

    public static void main(String[] args) {

        WaitNotifyLoopExecute execute = new WaitNotifyLoopExecute(2, 5);

        new Thread(()->{
            execute.execute(1, 2, a-> {
                System.out.println("当前线程ID:" + Thread.currentThread().getId() + "; 打印数据为:" + a);
            }, "dy");
        },"t1").start();

        new Thread(()->{
            execute.execute(2, 3, ()-> System.out.println("b"));
        },"t2").start();

        new Thread(()->{
            execute.execute(3, 4, ()-> System.out.println("c"));
        },"t3").start();

        new Thread(()->{
            execute.execute(4, 1, ()-> System.out.println("d"));
        },"t4").start();
    }
}
